﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AHMHRIRSF07.aspx.cs" Inherits="apps_ahmic_pages_AHMHRIRSF07" %>
<div class="form-outer">
<div class="form-header" id="formHeader" runat="server">
</div>
<div class="sub-pages" id="formContentOuter" runat="server">
    <div class="sub-page sub-page-default" data-section="list" data-path="Master>Maintain Tipe Tema">
        <div class="form-maincontent form-block grid">
            <div class="row">
                <div class="filter-panel" >
                    <div class="input-control text" data-role="input-control">
		                <input name="filter_tema" id="filter_tema" runat="server" type="text" placeholder="Masukkan nama tema" />
		                <button class="btn-clear" tabindex="-1"></button>
	                </div>
                    <button class="button medium default" id="ahmhrirsf07_btnFilterDefault" onclick="_fw_table_filter(this,$('#ahmhrirsf07_list'))"><i class="icon-filter on-left"></i>Filter Data</button>
                </div>
            </div>
            <div id="ahmhrirsf07_list" class="listContainer" runat="server">
            
            </div>
        </div>
    </div>
    <div class="sub-page" data-section="new" data-path="Master>Maintain Tipe Tema>Buat Tipe Tema">
        <div class="form-maincontent form-block grid">
            <div class="row">
                <div class="span6">
	                <label>Tipe ID *</label>
                    <div class="input-control text" data-role="input-control">
		                <input type="text" name="vtematype" value="" />
		                <button class="btn-clear" tabindex="-1"></button>
	                </div>

	                <label>Deskripsi Tipe *</label>
                    <div class="input-control text" data-role="input-control">
		                <input type="text" name="vtemaname" value="" />
		                <button class="btn-clear" tabindex="-1"></button>
	                </div>

	                <label>Status *</label>
                    <div class="input-control radio" data-role="input-control" style="margin-right:10px;">
                        <label>
                            <input type="radio" name="istatus" value="1" checked="checked" />
                            <span class="check"></span>
                            Aktif
                        </label>
                    </div>
                    <div class="input-control radio" data-role="input-control">
                        <label>
                            <input type="radio" name="istatus" value="0" />
                            <span class="check"></span>
                            Non Aktif
                        </label>
                    </div>
                </div>
            </div>
            <input type="hidden" name="action" value="ADD" />
        </div>
        <div class="main-form-toolbar-bottom">
            <button type="button" class="button medium primary" onclick="_fw_postData(this,'.sub-page[data-section=\'new\']','',ahmhrirsf07_updatesuccess)" >
	            <span class="icon-floppy"></span>
                Save Data
            </button>
        </div>
    </div>
    <div class="sub-page" data-section="edit" data-path="Master>Maintain Tipe Tema>Edit Tipe Tema">
        <div class="form-maincontent form-block grid">
            <div class="row">
                <div class="span6">
	                <label>Tipe ID *</label>
                    <div class="input-control text" data-role="input-control">
		                <input type="text" name="vtematype" value="" disabled="disabled" />
	                </div>

	                <label>Deskripsi Tipe *</label>
                    <div class="input-control text" data-role="input-control">
		                <input type="text" name="vtemaname" value="" />
		                <button class="btn-clear" tabindex="-1"></button>
	                </div>

	                <label>Status *</label>
                    <div class="input-control radio" data-role="input-control" style="margin-right:10px;">
                        <label>
                            <input type="radio" name="istatus" value="1" checked="checked" />
                            <span class="check"></span>
                            Aktif
                        </label>
                    </div>
                    <div class="input-control radio" data-role="input-control">
                        <label>
                            <input type="radio" name="istatus" value="0" />
                            <span class="check"></span>
                            Non Aktif
                        </label>
                    </div>

                </div>
            </div>
            <input type="hidden" name="vtematype" value="" />
            <input type="hidden" name="action" value="EDIT" />
        </div>
        <div class="main-form-toolbar-bottom">
            <button type="button" class="button medium primary" onclick="_fw_postData(this,'.sub-page[data-section=\'edit\']','',ahmhrirsf07_updatesuccess)" >
	            <span class="icon-floppy"></span>
                Update Data
            </button>
        </div>
    </div>
    <div class="sub-page" data-section="delete" data-path="Master>Maintain Tipe Tema>Hapus Tipe Tema" >
        <div class="form-maincontent form-block grid">
            <div class="row">
                <div class="span12">
                    <h2>The following data will be deleted. Are you sure?</h2>
                    <ul id="ahmhrirsf07_delconf">
                    </ul>
                </div>
            </div>
            <input type="hidden" name="action" value="DELETE" />
        </div>
        <div class="main-form-toolbar-bottom">
            <button type="button" class="button medium primary" onclick="_fw_postData(this,'.sub-page[data-section=\'delete\']', '', ahmhrirsf07_updatesuccess)" >
	            <span class="icon-floppy"></span>
                Delete Data
            </button>
        </div>
    </div>
    </div>
</div>
<script type="text/javascript">
    function ahmhrirsf07_new(obj) {
        var objFrame = $(obj).closest('.tab-frame');
        $('.sub-page[data-section="new"] input[name="istatus"][value="1"]', objFrame).prop("checked", true);
        _fw_navigateSubPage(obj, 'new');
    }
    function ahmhrirsf07_edit(obj) {
        var row = $(obj).closest('tr');
        var objFrame = $(obj).closest('.tab-frame');
        var stat = $('td:nth(3) .field-value', row).text().toLowerCase() == 'aktif' ? 1 : 0;
        $('.sub-page[data-section="edit"] :input[name="' + $('td:nth(1)', row).data('field-id') + '"]', objFrame).val($('td:nth(1) .field-value', row).html());
        $('.sub-page[data-section="edit"] :input[name="' + $('td:nth(2)', row).data('field-id') + '"]', objFrame).val($('td:nth(2) .field-value', row).html());
        $('.sub-page[data-section="edit"] :input[name="' + $('td:nth(3)', row).data('field-id') + '"][value="' + stat + '"]', objFrame).prop("checked", true);
        _fw_navigateSubPage(obj, 'edit');
    }
    function ahmhrirsf07_delete(obj) {
        var objFrame = $(obj).closest('.tab-frame');
        var tblid = $(obj).closest('.tableButtons').data('table-id');
        var tbl = $('table#' + tblid, objFrame);
        $('#ahmhrirsf07_delconf', objFrame).empty();
        $('.tblData.checks :input[type="checkbox"]:checked', tbl).each(function () {
            $('#ahmhrirsf07_delconf', objFrame).append('<li>' + $('td:nth(2) .field-value', $(this).closest('tr')).html() + '<input type="hidden" name="vtematype" value="' + $('td:nth(1) .field-value', $(this).closest('tr')).text() + '" /></li>');
        });
        _fw_navigateSubPage(obj, 'delete');
    }
    function ahmhrirsf07_updatesuccess(obj) {
        $('#ahmhrirsf07_btnFilterDefault').click();
        window.setTimeout(function () { _fw_navigateSubPage(obj, 'list'); }, 1000);
    }
    $(function () {
        $('#ahmhrirsf07_btnFilterDefault').click();
    });
</script>
</div>